3.1.5 \(\int \frac {\cot (x)}{a+a \cos (x)} \, dx\) [5]

Optimal. Leaf size=33 \[ -\frac {\tanh ^{-1}(\cos (x))}{2 a}+\frac {\cot (x) \csc (x)}{2 a}-\frac {\csc ^2(x)}{2 a} \]

[Out]

-1/2*arctanh(cos(x))/a+1/2*cot(x)*csc(x)/a-1/2*csc(x)^2/a

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 33, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.454, Rules used = {2785, 2686, 30, 2691, 3855} \begin {gather*} -\frac {\csc ^2(x)}{2 a}-\frac {\tanh ^{-1}(\cos (x))}{2 a}+\frac {\cot (x) \csc (x)}{2 a} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cot[x]/(a + a*Cos[x]),x]

[Out]

-1/2*ArcTanh[Cos[x]]/a + (Cot[x]*Csc[x])/(2*a) - Csc[x]^2/(2*a)

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2686

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rule 2691

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(a*Sec[e +
 f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m + n - 1))), x] - Dist[b^2*((n - 1)/(m + n - 1)), Int[(a*Sec[e + f*x])
^m*(b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] && NeQ[m + n - 1, 0] && Integers
Q[2*m, 2*n]

Rule 2785

Int[((g_.)*tan[(e_.) + (f_.)*(x_)])^(p_.)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[1/a, Int[S
ec[e + f*x]^2*(g*Tan[e + f*x])^p, x], x] - Dist[1/(b*g), Int[Sec[e + f*x]*(g*Tan[e + f*x])^(p + 1), x], x] /;
FreeQ[{a, b, e, f, g, p}, x] && EqQ[a^2 - b^2, 0] && NeQ[p, -1]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \frac {\cot (x)}{a+a \cos (x)} \, dx &=-\frac {\int \cot ^2(x) \csc (x) \, dx}{a}+\frac {\int \cot (x) \csc ^2(x) \, dx}{a}\\ &=\frac {\cot (x) \csc (x)}{2 a}+\frac {\int \csc (x) \, dx}{2 a}-\frac {\text {Subst}(\int x \, dx,x,\csc (x))}{a}\\ &=-\frac {\tanh ^{-1}(\cos (x))}{2 a}+\frac {\cot (x) \csc (x)}{2 a}-\frac {\csc ^2(x)}{2 a}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.04, size = 42, normalized size = 1.27 \begin {gather*} -\frac {1+2 \cos ^2\left (\frac {x}{2}\right ) \left (\log \left (\cos \left (\frac {x}{2}\right )\right )-\log \left (\sin \left (\frac {x}{2}\right )\right )\right )}{2 a (1+\cos (x))} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cot[x]/(a + a*Cos[x]),x]

[Out]

-1/2*(1 + 2*Cos[x/2]^2*(Log[Cos[x/2]] - Log[Sin[x/2]]))/(a*(1 + Cos[x]))

________________________________________________________________________________________

Maple [A]
time = 0.08, size = 28, normalized size = 0.85

method result size
default \(\frac {\frac {\ln \left (-1+\cos \left (x \right )\right )}{4}-\frac {1}{2 \left (\cos \left (x \right )+1\right )}-\frac {\ln \left (\cos \left (x \right )+1\right )}{4}}{a}\) \(28\)
risch \(-\frac {{\mathrm e}^{i x}}{\left ({\mathrm e}^{i x}+1\right )^{2} a}+\frac {\ln \left ({\mathrm e}^{i x}-1\right )}{2 a}-\frac {\ln \left ({\mathrm e}^{i x}+1\right )}{2 a}\) \(47\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(x)/(a+a*cos(x)),x,method=_RETURNVERBOSE)

[Out]

1/a*(1/4*ln(-1+cos(x))-1/2/(cos(x)+1)-1/4*ln(cos(x)+1))

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 31, normalized size = 0.94 \begin {gather*} -\frac {\log \left (\cos \left (x\right ) + 1\right )}{4 \, a} + \frac {\log \left (\cos \left (x\right ) - 1\right )}{4 \, a} - \frac {1}{2 \, {\left (a \cos \left (x\right ) + a\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)/(a+a*cos(x)),x, algorithm="maxima")

[Out]

-1/4*log(cos(x) + 1)/a + 1/4*log(cos(x) - 1)/a - 1/2/(a*cos(x) + a)

________________________________________________________________________________________

Fricas [A]
time = 0.41, size = 37, normalized size = 1.12 \begin {gather*} -\frac {{\left (\cos \left (x\right ) + 1\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - {\left (\cos \left (x\right ) + 1\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) + 2}{4 \, {\left (a \cos \left (x\right ) + a\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)/(a+a*cos(x)),x, algorithm="fricas")

[Out]

-1/4*((cos(x) + 1)*log(1/2*cos(x) + 1/2) - (cos(x) + 1)*log(-1/2*cos(x) + 1/2) + 2)/(a*cos(x) + a)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\cot {\left (x \right )}}{\cos {\left (x \right )} + 1}\, dx}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)/(a+a*cos(x)),x)

[Out]

Integral(cot(x)/(cos(x) + 1), x)/a

________________________________________________________________________________________

Giac [A]
time = 0.46, size = 34, normalized size = 1.03 \begin {gather*} -\frac {\log \left (\cos \left (x\right ) + 1\right )}{4 \, a} + \frac {\log \left (-\cos \left (x\right ) + 1\right )}{4 \, a} - \frac {1}{2 \, a {\left (\cos \left (x\right ) + 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)/(a+a*cos(x)),x, algorithm="giac")

[Out]

-1/4*log(cos(x) + 1)/a + 1/4*log(-cos(x) + 1)/a - 1/2/(a*(cos(x) + 1))

________________________________________________________________________________________

Mupad [B]
time = 0.34, size = 21, normalized size = 0.64 \begin {gather*} \frac {2\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )-{\mathrm {tan}\left (\frac {x}{2}\right )}^2}{4\,a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(x)/(a + a*cos(x)),x)

[Out]

(2*log(tan(x/2)) - tan(x/2)^2)/(4*a)

________________________________________________________________________________________